//
// Created by sjjmw on 3/24/2022.
//
#include "iostream"
#include "vector"
#include "list"
#include "algorithm"
#include "string"
#include "unordered_map"
#include "cmath"
#include<iomanip>
#include "string"
#include "map"
#include "list"
struct Pos{
    int x;
    int y;
};
struct Sol{
    int guowang_x;
    int guowang_y;
    int w;
    int ans=0;
    std::vector<Pos> puted;
    bool putable(int x,int y){
        if(abs(x-guowang_x)<=1&&
            abs(y-guowang_y)<=1){
            return false;
        }
        for(int i=puted.size()-1;i>=0;i--){
            auto&cur=puted[i];
            if(cur.x-x==cur.y-y){
                return false;
            }
            if(cur.x==x){
                return false;
            }
            if(cur.x-x==y-cur.y){
                return false;
            }
        }
        return true;
    }
    //深度代表行
    void dfs(int depth){
        if(depth==w){
            ans++;
            return;
        }
        for(int i=0;i<w;i++){
            if(putable(i,depth)){
                puted.push_back({i,depth});
                dfs(depth+1);
                puted.pop_back();
            }
        }
    }
    void handle(int n,int x1,int y1
            ){
        guowang_x=x1-1;
        guowang_y=y1-1;
        w=n;
        puted.reserve(w);
        dfs(0);
        printf("%d\n",ans);
        ;
    }
};
int main(){
//    int a,b,c;
    float a,b,c,d;
    int e;
    while(std::cin>>a>>b>>c){
        Sol().handle(a,b,c);
    }

    return 0;
}